<?php
    include('./conn.php');

    $username=$_GET['username'];

    $sql="SELECT * from `users` where username='$username'";

    $result=$mysqli->query($sql);

    if($result->num_rows>0){
        echo '{"hasname":true,"msg":" × 用户名已存在"}';
    }else{
        echo '{"hasname":false,"msg":"√"}';
    }
    $mysqli->close();
?>